/**
 * $Revision: 1.0 $
 * $Author: Eric Yang $
 * $Date: Aug 13, 2009 12:49:26 AM $
 *
 * Author: Eric Yang
 * Date  : Aug 13, 2009 12:49:26 AM
 *
 */
package com.gooex.web.action.organization.user;

import java.util.ArrayList;
import java.util.List;

import com.gooex.domain.organization.Role;
import com.gooex.domain.organization.User;
import com.gooex.web.action.BaseProtectedAction;


/**
 * @author Eric Yang
 * @version 1.0
 */
public class ListUser extends BaseProtectedAction {

	public List<User> getUsers() {
		Role role = sessionContext.getUser().getRole();
		if (isSystemObject(role))
			return userManager.getUsers();
		else if (role.isGrantor())
			return role.getUsers();
		else
			return new ArrayList<User>();
	}
}
